<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="format-detection" content="telephone = no">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <style type="text/css">
         .item {
         padding: 20px;
         max-width: 600px;
         margin: 0 auto;
         text-align: center;
         background-color: #999999;
         margin-top: 20px;
         }

    </style>
    <script>
        function callAppToast() {
            console.log("callAppToast.");
            myjs.takeNativeAction("showToast", {message: "this is a message from html."});
        }

        function login() {
            console.log("login.");
            myjs.takeNativeActionWithCallback("login", {}, function(res) {
                 alert(JSON.stringify(res));
            });
        }


    </script>
    <script src="js/xiangxuejs.js" charset="UTF-8"></script>
</head>
<body style="height: 100%;">
<div class="item" style="font-size: 20px; color: #ffffff" onclick="callAppToast()">调用: showToast</div>
<div id="login_id" class="item" style="font-size: 20px; color: #ffffff" onclick="login()">登录并且返回结果</div>
</body>
</html>